@import '~antd/lib/style/themes/default.less';
@import '~@/styles/variable.less';
@import '~codemirror/lib/codemirror.css';

@font-face {
  font-family: 'Source Code Pro';
  src: url('../assets/fonts/SourceCodePro-Regular.ttf.woff2') format('woff2'),
    url('../assets/fonts/SourceCodePro-Regular.otf.woff') format('woff'),
    url('../assets/fonts/SourceCodePro-Regular.ttf') format('truetype');
}

.log-modal {
  .ant-modal {
    padding-bottom: 0 !important;
    width: 580px !important;
  }

  pre {
    white-space: break-spaces;
    line-height: 17px;
    margin-bottom: 0;
    overflow: hidden;
  }
}

.monaco-editor:not(.rename-box) {
  height: calc(100vh - 128px) !important;
  height: calc(100vh - var(--vh-offset, 0px) - 128px) !important;
  .view-overlays .current-line {
    border-width: 0;
  }
}

.rename-box {
  height: 0;
  .rename-input {
    height: 0;
    padding: 0 !important;
    display: none !important;
  }
}

.ant-pro-grid-content.wide {
  max-width: unset !important;
  overflow: auto;
  .ant-pro-page-container-children-content {
    overflow: auto;
    height: 100%;
    background-color: #fff;
    padding: 16px;
  }
}

.ant-table-cell-ellipsis {
  text-align: left !important;
}

.ant-tooltip {
  max-width: 500px !important;
  .ant-tooltip-inner {
    word-break: break-all !important;
  }
}

.env-wrapper {
  th {
    white-space: nowrap;
  }
}

.log-wrapper {
  .log-select {
    width: 250px;
  }
  .ant-page-header-heading-left {
    min-width: 100px;
  }
}

.config-wrapper {
  .config-select {
    width: 250px;
  }
  .ant-page-header-heading-left {
    min-width: 100px;
  }
}

.ant-tree {
  .ant-tree-treenode {
    width: 100%;
    padding-right: 8px !important;
  }

  .ant-tree-node-content-wrapper {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }
}

.ant-select-tree {
  .ant-select-tree-treenode {
    width: 100%;
    padding-right: 8px !important;
  }

  .ant-select-tree-node-content-wrapper {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }
}

.ant-pro-page-container.ql-container-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
  height: calc(100vh - var(--vh-offset, 0px) - 48px);
  .ant-pro-grid-content.wide {
    flex: 1;
    .ant-pro-grid-content-children {
      height: calc(100% - 36px);
      > div,
      .log-container,
      .react-codemirror2,
      .CodeMirror {
        height: 100%;
      }
    }
  }
}

@media (max-width: 768px) {
  .ql-container-wrapper {
    &.crontab-wrapper,
    &.log-wrapper,
    &.env-wrapper,
    &.config-wrapper {
      .CodeMirror {
        width: calc(100vw - 80px);
      }
    }
  }

  .ant-tooltip {
    max-width: 250px !important;
  }
}

.ant-layout-content.ant-pro-basicLayout-content.ant-pro-basicLayout-has-header {
  margin-bottom: 0 !important;
  min-height: calc(100vh - 72px);
  min-height: calc(100vh - var(--vh-offset, 0px) - 72px);
}

.Resizer {
  background: #fff;
  opacity: 0.2;
  z-index: 1;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -moz-background-clip: padding;
  -webkit-background-clip: padding;
  background-clip: padding-box;
  border-left: 5px solid rgba(42, 161, 255, 0);
  border-right: 5px solid rgba(42, 161, 255, 0);
}

.Resizer:hover {
  -webkit-transition: all 2s ease;
  transition: all 2s ease;
}

.Resizer.horizontal {
  height: 11px;
  margin: -5px 0;
  cursor: row-resize;
  width: 100%;
}

.Resizer.vertical {
  width: 11px;
  margin: 0 -5px;
  cursor: col-resize;
}

.Resizer.horizontal:hover,
.Resizer.vertical:hover {
  border-left-color: rgba(42, 161, 255, 0.5);
  border-right-color: rgba(42, 161, 255, 0.5);
}

.Resizer.disabled {
  cursor: not-allowed;
}
.Resizer.disabled:hover {
  border-color: transparent;
}

.edit-modal {
  .ant-drawer-body {
    padding: 0;
  }
}

.inline-countdown.ant-statistic {
  display: inline-block;
  .ant-statistic-content {
    font-size: 14px;
    padding: 0 3px;
  }
}

.ant-form-item-extra {
  word-break: break-all;
  font-size: 13px;
}

[data-dark='true'] {
  /* Change autocomplete styles in WebKit */
  input:-webkit-autofill,
  input:-webkit-autofill:hover,
  input:-webkit-autofill:focus,
  textarea:-webkit-autofill,
  textarea:-webkit-autofill:hover,
  textarea:-webkit-autofill:focus,
  select:-webkit-autofill,
  select:-webkit-autofill:hover,
  select:-webkit-autofill:focus {
    border: 1px solid @border-color-base;
    box-shadow: none;
    transition: background-color 5000s ease-in-out 0s;
    -webkit-text-fill-color: @text-color;
    caret-color: #e8e6f3 !important;
  }

  ::placeholder {
    opacity: 0.5 !important;
  }

  .ant-select-selection-placeholder {
    opacity: 0.5 !important;
  }
}

.ant-pro-page-container-children-content {
  margin: 18px 18px 18px;
}

.ant-pro-basicLayout-content {
  margin: 18px;
  .ant-pro-page-container {
    margin: -18px -18px -18px;
  }
}

.ant-menu-item.ant-pro-sider-collapsed-button {
  margin: 0;
}

.side-menu-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(0, 0, 0, 0.85);

  .side-menu-collapse-button:hover {
    color: #1890ff;
  }

  .side-menu-user-wrapper {
    display: flex;
    align-items: center;
  }
}

.side-menu-user-drop-menu {
  position: relative;
  margin: 0;
  padding: 4px 0;
  text-align: left;
  background-clip: padding-box;
  outline: none;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 16px -8px rgb(0 0 0 / 8%), 0 9px 28px 0 rgb(0 0 0 / 5%),
    0 12px 48px 16px rgb(0 0 0 / 3%);
  .ant-dropdown-menu-item:hover {
    color: #1890ff;
  }
}

.ant-pro-sider-logo {
  padding: 16px 8px !important;
  h1 {
    margin-left: 5px !important;
  }
  img {
    width: 32px !important;
    border-radius: 52% !important;
  }
}

.ant-pro-global-header-logo {
  a img {
    // 移动端logo被拉伸
    width: auto !important;
  }
}
